Computer code has traditionally been developed to run as a single execution thread, executing on a single processing unit. The individual functions of computer code with such architecture can call each other with relative ease; each function would be compiled to a certain memory address, and a pointer to that memory address would be established. Whenever the single execution thread needed access to a function, it would use the appropriate memory address pointer to call the function, and pass parameters as necessary. Because the computer code had only one execution thread and executed on only one processing unit, the computer coded executed linearly and synchronization was not an issue.
Computer network architecture added a layer of complexity by allowing potentially-related computer code to run independent execution threads simultaneously. In client-server based computer code, a client application running on one processing unit requests some type of data or function execution from a server application; the client application may then have to wait for the server application to return a result before the client application can continue to execute. In client-server architecture, the client application and the server application communicate through remote procedure calls (RPC).
RPC is a mechanism for communicating between separate processes. Processes do not share memory; therefore a memory address within the scope of one process will point to entirely different data than the same memory address within the scope of a different process. RPC converts a procedure call, such as a function call, from a memory address pointer to a format recognizable to the receiving process; then it packages the procedure call along with any necessary parameters into a data packet and calls network infrastructure handling mechanisms to deliver the packet to the receiving process. The receiving process then unpacks the data packet, converts the procedure call to a recognizable memory address pointer, and executes the procedure. The same mechanisms and methodology are used to return data from the receiving process to the sending process. The overhead cost for RPC is high; processes must use system resources to convert memory address pointers, and must use system resources to access network infrastructure. RPC is affective for client-server processes because the client process and server process are often running on separate computers, only accessible through digital network.
Recently, as more and more computers incorporate multiple cores, or processing units, traditional single threaded computer code is being converted to use multiple independent threads. Conversion of existing single-threaded computer code to a multi-threaded implementation improves performance because the various execution threads can be allocated to individual processing units which can execute each execution thread in parallel. However, this conversion process is labor intensive due to inherent differences in the design paradigms for single-threaded computer code and multi-threaded computer code. To minimize the labor involved, software developers often leave less-performance-critical code running in one single execution thread. However, performance-critical code converted to run as multiple execution threads may contain function calls into less-performance-critical code. Thus conversion of single threaded computer code to multi-threaded computer code requires some synchronous inter-thread communication method which allows performance-critical threads to call upon less-performance-critical threads.
As with client-server implementations, the conventional mechanism for inter-thread communication is RPC. Whereas RPC is relatively efficient for inter-process communication, RPC is relatively inefficient for inter-thread communication because inter-thread communication does not require the use of network infrastructure, so the overhead cost of many RPC operations is wasted in multi-thread communication.